﻿using System;
using System.IO;
using System.Security.Cryptography;

namespace Bing_Wallpaper_Downloader
{
    internal class HashValue
    {
        public static string GetHash(string file)
        {
            using (HashAlgorithm hashAlgorith = new SHA1Managed())
            {
                using (Stream stream = new FileStream(file, FileMode.Open, FileAccess.Read))
                {
                    byte[] bytes = hashAlgorith.ComputeHash(stream);

                    return BitConverter.ToString(bytes);
                }
            }
        }
    }
}
